#!/bin/bash -x

# Configure Triton CNs to use the same ssh keys as the headnode.
node_config=/usbkey/extra/joysetup/node.config
if ! grep -q root_authorized_keys_file "$node_config" ; then
	echo "root_authorized_keys_file='root.authorized_keys'" >> "$node_config"
fi
sdc-oneachnode -X -c -g /usbkey/config.inc/root.authorized_keys -d /opt/smartdc/config/
sdc-oneachnode -c 'svcadm restart smartdc/config'